<?php namespace Member\Controller; 

use Hdphp\Controller\Controller;
use Member\Model\Order;
class OrderController extends Controller
{
	protected $db;

	//构造函数
	public function __init()
	{
		$this->db = new Order;
	}
	
    //动作
    public function order(){
    	$order = $this->db->where('hd_shop_user_id',$_SESSION['id'])->get();
    	sort($order);
    	if($order){
    		$data = array();
	    	foreach($order as $value){
	    		$orderlist = Db::table('shop_orderlist')->where('hd_shop_order_oid',$value['oid'])->get();
	    		$tmp[] = $orderlist;    		   		
	    	}
	    	$data = $tmp;
	    	View::with('order',$order);
	    	View::with('data',$data);
    	}
    	
       	View::make();
    }
}
